//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI.WebControls;
using CommunityServer.Reader.Components;

namespace CommunityServer.Reader.Controls
{
	/// <summary>
	/// Summary description for FolderListing.
	/// </summary>
	public class RollerFeedListing : RollerTemplatedWebControl
	{

		#region Private Members

		private Repeater rFeeds;

		#endregion

		#region Constructor(s)

		public RollerFeedListing()
		{
		}

		#endregion

		#region Class Methods

		protected override void AttachChildControls()
		{
			rFeeds = (Repeater) FindControl("rFeeds");
		}

		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad (e);
			if(!Page.IsPostBack)
				DataBind();
		}


		public override void DataBind()
		{
			base.DataBind ();

			int userId = Users.GetAnonymousUser().UserID;

			rFeeds.DataSource = FeedReaderDataProvider.Instance().GetRollerFeeds(userId);
			rFeeds.DataBind();

		}

		#endregion

	}
}
